package com.zdj.data.datasource;

import com.zdj.data.entity.User;
import com.zdj.data.net.RetrofitClient;
import com.zdj.data.services.IUserService;

import java.util.List;

import retrofit2.adapter.rxjava.Result;
import rx.Observable;

/**
 * 远程数据
 * Created by zdj on 16-6-26.
 */

public class UserCloudDataStore extends BaseDataStore<User> {
    @Override
    public Observable<List<User>> entityList(String... strings) {
        return RetrofitClient.createService(IUserService.class).loadUsers();
    }

    @Override
    public Observable entityDetails(int id,String... strings) {
        return RetrofitClient.getInstance().create(IUserService.class).loadUser(String.valueOf(id));
    }

    @Override
    public Observable<Result<User>> getEntity() {
        return null;
    }
}
